Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support .Net C# projects using dotnet cli and nuget.org central repository. #62

Merged
merged 28 commits into from
Jul 2, 2021

Conversation

navteniev
Copy link
Contributor

Added an new backend dotnet which is implemented using the dotnet cli which is distributed for many platforms and nuget.org with is the central repository for shared .Net packages.

Tested with a sample local project.

$ upm list
name                           spec  
----------------------------   ------
Microsoft.Extensions.Logging   5.0.0 
Newtonsoft.Json                13.0.1
SharpYaml                      1.6.6 
upm list -a
name                                                    version
-----------------------------------------------------   -------
Microsoft.Extensions.DependencyInjection                5.0.0  
Microsoft.Extensions.DependencyInjection.Abstractions   5.0.0  
Microsoft.Extensions.Logging                            5.0.0  
Microsoft.Extensions.Logging.Abstractions               5.0.0  
Microsoft.Extensions.Options                            5.0.0  
Microsoft.Extensions.Primitives                         5.0.0  
Microsoft.NETCore.Platforms                             1.1.0  
Microsoft.NETCore.Targets                               1.1.0  
Newtonsoft.Json                                         13.0.1 
SharpYaml                                               1.6.6  
System.IO                                               4.3.0  
System.Reflection                                       4.3.0  
System.Reflection.Primitives                            4.3.0  
System.Reflection.TypeExtensions                        4.3.0  
System.Runtime                                          4.3.0  
System.Text.Encoding                                    4.3.0  
System.Threading.Tasks                                  4.3.0  
upm remove Microsoft.Extensions.Logging

--> dotnet remove testApp.csproj package Microsoft.Extensions.Logging
info : Removing PackageReference for package 'Microsoft.Extensions.Logging' from project 'testApp.csproj'.
--> dotnet restore --use-lock-file
  Determining projects to restore...
  Restored /testApp/testApp.csproj (in 283 ms).
upm add Microsoft.Extensions.Logging

--> dotnet add package Microsoft.Extensions.Logging
  Determining projects to restore...
  Writing /var/folders/8j/vg3f4hld5cs65rxmgcfgllk00000gp/T/tmpcyZfXU.tmp
info : Adding PackageReference for package 'Microsoft.Extensions.Logging' into project '/testApp/testApp.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.extensions.logging/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.extensions.logging/index.json 46ms
info : Restoring packages for /testApp/testApp.csproj...
info : Package 'Microsoft.Extensions.Logging' is compatible with all the specified frameworks in project '/testApp/testApp.csproj'.
info : PackageReference for package 'Microsoft.Extensions.Logging' version '5.0.0' added to file '/testApp/testApp.csproj'.
info : Committing restore...
info : Writing assets file to disk. Path: /Users/daddy/Code/testApp/obj/project.assets.json
info : Writing packages lock file at disk. Path: /Users/daddy/Code/testApp/packages.lock.json
log  : Restored /testApp/testApp.csproj (in 151 ms).
upm info Microsoft.Extensions.Logging

--> latest version of Microsoft.Extensions.Logging is 6.0.0-preview.3.21201.4
--> Getting spec from https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging/6.0.0-preview.3.21201.4/microsoft.extensions.logging.nuspec
Name:          Microsoft.Extensions.Logging
Description:   Logging infrastructure default implementation for Microsoft.Extensions.Logging.
Version:       6.0.0-preview.3.21201.4
Homepage:      https://dot.net
Source code:   https://github.com/dotnet/runtime
License:       MIT
upm search Logging

--> Microsoft.Extensions.Logging.Abstractions
--> Microsoft.Extensions.Logging
--> Microsoft.Extensions.Logging.Configuration
--> Microsoft.IdentityModel.Logging
--> Microsoft.Extensions.Logging.Console
--> Microsoft.Extensions.Logging.Debug
--> Microsoft.Extensions.Logging.EventSource
--> Serilog.Extensions.Logging
--> Microsoft.Extensions.Logging.EventLog
--> Common.Logging
--> less -S

@navteniev navteniev mentioned this pull request Apr 9, 2021
@navteniev
Copy link
Contributor Author

@dan-stowell, and @Zabot would you be willing to look at this PR?

@dan-stowell
Copy link
Contributor

@turbio are these the same dotnet packages as the ones in our super-alpha template?

@navteniev
Copy link
Contributor Author

@dan-stowell are there any change I would need to make to get this change merged?

Copy link
Contributor

@ALANVF ALANVF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited for this one!

internal/backends/dotnet/dotnet.go Outdated Show resolved Hide resolved
internal/backends/dotnet/nuget.go Outdated Show resolved Hide resolved
internal/backends/dotnet/project_files.go Outdated Show resolved Hide resolved
@navteniev navteniev requested a review from ALANVF June 30, 2021 14:31
Copy link
Contributor

@lhchavez lhchavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test coverage! just some relatively minor comments and we should be good to go

internal/backends/dotnet/nuget.go Outdated Show resolved Hide resolved
internal/backends/dotnet/nuget.go Outdated Show resolved Hide resolved
internal/backends/dotnet/nuget.go Show resolved Hide resolved
internal/backends/dotnet/nuget.go Outdated Show resolved Hide resolved
internal/backends/dotnet/project_files.go Outdated Show resolved Hide resolved
internal/backends/dotnet/project_files.go Outdated Show resolved Hide resolved
internal/backends/dotnet/project_files.go Outdated Show resolved Hide resolved
navteniev and others added 4 commits July 2, 2021 10:53
The query string comes directly from the command line and might contain characters that are not valid in query parameters.

Co-authored-by: lhchavez <[email protected]>
PackageNames might contain characters that are not valid in URL path.

Co-authored-by: lhchavez <[email protected]>
There is no guarantee that after you check for files existence that it will still be there when the code attempts to open it.  This way the check and open operation are done in a single call.

Co-authored-by: lhchavez <[email protected]>
Copy link
Contributor

@lhchavez lhchavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#️⃣

@navteniev
Copy link
Contributor Author

@ALANVF mind taking another look?

@ALANVF
Copy link
Contributor

ALANVF commented Jul 2, 2021

Sure thing

@ALANVF
Copy link
Contributor

ALANVF commented Jul 2, 2021

Very pog 👍

@ALANVF ALANVF merged commit 6306a65 into replit:master Jul 2, 2021
@blast-hardcheese blast-hardcheese added major enhancement New feature or request labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants